import { useState, useEffect } from "react";
// import http from "@/utils/http";
import { ratedApi } from "@/utils/api";

const Index = () => {
  const [rated_list, set_rated_list] = useState([]);

  useEffect(() => {
    (async () => {
      const res = await ratedApi({ a: 3, b: 4 });
      set_rated_list(res.result);
    })();
  }, []);

  return (
    <div>
      <h3>这是电影页面</h3>
      <ul>
        {rated_list.map((item) => (
          <li key={item._id}>{item.title}</li>
        ))}
      </ul>
    </div>
  );
};

export default Index;
